package com.woniu.learnlog.controller;


import com.woniu.learnlog.service.LogService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * created by woniu201
 * created in 2018/3/30
 */

@Slf4j
@RestController
public class LogController {
    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private  LogService logService;

    @RequestMapping(value = "/test",method = RequestMethod.GET)
    public void testLogLevel(){
        logger.debug("this is debugger");
        logger.info("this is info");
        logger.error("this is error");

        log.info("aaaaaaaaaaaaaaaaaa");
        logService.logService1();
        return ;
    }

    @RequestMapping(value = "/test1", method = RequestMethod.GET)
    public String testLog2(){
        log.info("aaaaaaaaaa");
        return "aaaaa";
    }
}
